(require 'compile)


(defun my-compile ()
  (interactive)
  (let ((current-prefix-arg (list "1")))
    (call-interactively 'compile))
  )

(defun compilation-make-all ()
  "make all for project"
  (interactive)
  (compilation-start "make all"))
(defun compilation-make-clean ()
  "make clean for project"
  (interactive)
  (compilation-start "make clean"))
(defun compilation-make-install ()
  "make install for project"
  (interactive)
  (compilation-start "make install"))

;; compile
(global-set-key (kbd "C-c c") 'my-compile)
(global-set-key (kbd "C-c v") 'recompile)
(global-set-key (kbd "C-c a") 'compilation-make-all)
(global-set-key (kbd "C-c C") 'compilation-make-clean)
(global-set-key (kbd "C-c I") 'compilation-make-install)

(defun compile-settings ()
  
  (define-key compilation-mode-map (kbd "q") nil)
  (define-key compilation-mode-map (kbd "c") 'compilation-make-clean)
  (define-key compilation-mode-map (kbd "i") 'compilation-make-install)
  )

(eval-after-load "compile"
 `(compile-settings))

(provide 'init-compile)
